﻿@inherits ComponentDefault
@using ThingsGateway.Admin.Application
@namespace ThingsGateway.Admin.Razor

<div class="tree-menu">
    <TreeView TItem="OpenApiPermissionTreeSelector" Items="Items" ShowCheckbox="true" ShowIcon="true" AutoCheckParent="true" AutoCheckChildren="true" OnTreeItemChecked="OnTreeItemChecked" ModelEqualityComparer="ModelEqualityComparer"></TreeView>

    <div class="form-footer">
        <Button IsAsync Color="Color.Secondary" Icon="fa-solid fa-xmark" Text="@DefaultLocalizer["Close"]" OnClickWithoutRender="OnClickClose" />
        <Button IsAsync Color="Color.Primary" Icon="fa-solid fa-check" Text="@DefaultLocalizer["Save"]" OnClickWithoutRender="OnClickSave" />
    </div>
</div>

@code {
    RenderFragment<OpenApiPermissionTreeSelector> RenderTreeItem => item =>
    @<div class="d-flex flex-fill " style="padding-right: 5rem!important;padding-left: 0rem!important;">
        <span class="flex-fill">@item.ApiName</span>
        <span class="mx-1 menu-type">@item.ApiRoute</span>
    </div>;
}
